import { EPokerState, ESuit } from "../constant/GameEnum";
import UIPoker from "../view/poker/UIPoker";
import PokerGroupVo from "./PokerGroupVo";

export default class PokerVo {
  public point: number = -1;
  public suit: ESuit = ESuit.HeiTao;
  private _state: EPokerState = EPokerState.CLOSE;
  private view: UIPoker = null;
  public parent: PokerGroupVo = null;
  constructor(point: number, suit: ESuit, state: EPokerState) {
    this.point = point;
    this.suit = suit;
    this._state = state;
  }
  public init(): void {
    this._state = EPokerState.CLOSE;
    this.parent = null;
  }
  public set setView(view: UIPoker) {
    this.view = view;
  }
  public get getView(): UIPoker {
    return this.view;
  }
  public get state(): EPokerState {
    return this._state;
  }
  public set state(v: EPokerState) {
    this._state = v;
  }
  public get indexInGroup(): number {
    return this.parent.getIndexByGroup(this);
  }
}
